#ifndef __UART2_H__
#define __UART2_H__

#include "debug.h"

#define RXBUF_SIZE2 (256)

extern u8 rxBuffer2[RXBUF_SIZE2];
extern uint16_t rxBuffer2ReadPos;

void UART2_GPIO_Init(void);
void UART2_Init(uint32_t baudrate);
void UART2_DMA_Init(void);

char uart2WriteBlocking(char *data, uint16_t num);
char uart2WriteStrBlocking(char *str);
uint32_t uart2Read(char *buffer, uint16_t num);
char uart2ReadByte(void);
uint16_t uart2Available(void);
char uart2Peek(uint8_t Serial_num, uint16_t offset);

void UART2x_DMA_init(uint32_t btl);

#endif